package com.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.service.StoreupService;
import java.util.*;

import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.utils.PageUtils;
import com.utils.Query;


import com.dao.WeibaojihuaDao;
import com.entity.WeibaojihuaEntity;
import com.service.WeibaojihuaService;
import com.entity.vo.WeibaojihuaVO;
import com.entity.view.WeibaojihuaView;

@Service("weibaojihuaService")
public class WeibaojihuaServiceImpl extends ServiceImpl<WeibaojihuaDao, WeibaojihuaEntity> implements WeibaojihuaService {


    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        Page<WeibaojihuaEntity> page = this.selectPage(
                new Query<WeibaojihuaEntity>(params).getPage(),
                new EntityWrapper<WeibaojihuaEntity>()
        );
        return new PageUtils(page);
    }

    @Override
    public PageUtils queryPage(Map<String, Object> params, Wrapper<WeibaojihuaEntity> wrapper) {
        Page<WeibaojihuaView> page = new Query<WeibaojihuaView>(params).getPage();
        page.setRecords(baseMapper.selectListView(page, wrapper));
        PageUtils pageUtil = new PageUtils(page);
        return pageUtil;
    }

    @Override
    public List<WeibaojihuaVO> selectListVO(Wrapper<WeibaojihuaEntity> wrapper) {
        return baseMapper.selectListVO(wrapper);
    }

    @Override
    public WeibaojihuaVO selectVO(Wrapper<WeibaojihuaEntity> wrapper) {
        return baseMapper.selectVO(wrapper);
    }

    @Override
    public List<WeibaojihuaView> selectListView(Wrapper<WeibaojihuaEntity> wrapper) {
        return baseMapper.selectListView(wrapper);
    }

    @Override
    public WeibaojihuaView selectView(Wrapper<WeibaojihuaEntity> wrapper) {
        return baseMapper.selectView(wrapper);
    }

}
